package org.dromara.web.client.address;

import com.dtflys.forest.callback.AddressSource;
import com.dtflys.forest.http.ForestAddress;
import com.dtflys.forest.http.ForestRequest;
import org.springframework.beans.factory.annotation.Value;

public class WxAddressSourceTest implements AddressSource {

    @Value("${wx.address}")
    private String address;

    @Value("${wx.port}")
    private int port;
    @Override
    public ForestAddress getAddress(ForestRequest forestRequest) {
//        String[] ipArray = new String[] {
//            "192.168.0.1",
//            "192.168.0.2",
//            "192.168.0.3",
//        };
//        // 随机选出其中一个
//        Random random = new Random();
//        int i = random.nextInt(3);
//        String ip = ipArray[i];
        return new ForestAddress(address,port);
    }
}
